<?php

namespace App\Http\Controllers\Client\Common;

use App\Http\Controllers\RootController as Controller;
use App\Models\Org;
use Illuminate\Http\Request;

class OrgController extends Controller
{
    public function handle(Request $request)
    {
        $param['org_id'] = $request->get('org_id');

        $rules    = [
            'org_id' => 'required',
        ];
        $messages = [
            'org_id.required'                   => '请输入单位id',
        ];

        if (true !== ($error = $this->validator($param, $rules, $messages)))
        {
            return $this->failure($error, 'VALIDATION_FAIL');
        }


        $org = Org::find($param['org_id'])->toArray();

        return $this->success($org);
    }
}
